﻿Module Module4

    Sub Main()
        Console.WriteLine("Module4 流程控制")
        Console.WriteLine()
        
        Dim x, y As Integer
        Dim s As String

        Do
            Console.WriteLine("請輸入 X 座標: ")
            s = Console.ReadLine()
            x = Val(s)
            If x < 0 Then
                Console.WriteLine("錯誤: X 不能小於 0")
            End If
        Loop While x < 0

        Console.WriteLine("請輸入 Y 座標: ")
        s = Console.ReadLine()
        y = Val(s)

        Console.Clear()
        Console.SetCursorPosition(x, y)
        Console.Write("*")

        Console.ReadKey()
    End Sub

End Module
